import request from '@/utils/request';
// 单品设置
export async function getSingleList(params = {}) {
  return request('/Amaidan-Distribution-Web/distribution/distributionGoodsRef/pageQuery', {
    method: 'POST',
    data: params,
  });
}

export async function startGoodsRef(params = {}) {
  return request('/Amaidan-Distribution-Web/distribution/distributionGoodsRef/updateDistributionGoodsRef', {
    method: 'POST',
    data: params,
  });
}

export async function settingPlans(params = {}) {
  return request('/Amaidan-Distribution-Web/distribution/distributionGoodsRef/batchSetGoodsByGoodsIdAndNormDetailPriceId', {
    method: 'POST',
    data: params,
  });
}

export async function distributionPlanName(params) {
  return request('/Amaidan-Distribution-Web/distribution/distributionBaseSetting/distributionPlan/allOpen', {
    method: 'GET',
    data: params,
  });
}

export async function goodsCatalog(params) {
  return request('/Amaidan-Goods-Web/resGoods/cat/selectCatByParentIdAndStoreId', {
    method: 'POST',
    data: params,
  });
}

// 会员卡分销
export async function fetchMembershipCards(params = {}) {
  return request('/Amaidan-Distribution-Web/distribution/employeeCashRegisterSetting/pageQueryEmployeeCashRegisterSetting', {
    method: 'POST',
    data: params,
  });
}

export async function editMembershipCards(params = {}) {
  return request('/Amaidan-Distribution-Web/distribution/employeeCashRegisterSetting/updateCardEmployeeCashRegisterSetting', {
    method: 'POST',
    data: params,
  });
}
// 全员收银
export async function editWholeCashier(params = {}) {
  return request('/Amaidan-Distribution-Web/distribution/employeeCashRegisterSetting/updateEmployeeCashRegisterSetting', {
    method: 'POST',
    data: params,
  });
}

export async function editWholeCashierStatus(params = {}) {
  return request('/Amaidan-Distribution-Web/distribution/employeeCashRegisterSetting/changeEmployeeCashRegisterSettingStatus', {
    method: 'POST',
    data: params,
  });
}
// 基础设置
export async function fetchBaseSetting(params = {}) {
  return request('/Amaidan-Distribution-Web/payments/baseInfo', {
    method: 'POST',
    data: params,
  });
}

export async function baseSettingClose(params = {}) {
  return request('/Amaidan-Distribution-Web/payments/close', {
    method: 'POST',
    data: params,
  });
}

export async function saveBaseSetting(params = {}) {
  return request('/Amaidan-Distribution-Web/payments/baseInfo/save', {
    method: 'POST',
    data: params,
  });
}
// 方案设置
export async function fetchSchemeLists(params) {
  return request(`/Amaidan-Distribution-Web/distribution/distributionBaseSetting/distributionPlan/${params}`);
}

export async function addScheme(params) {
  return request(`/Amaidan-Distribution-Web/distribution/distributionBaseSetting/distributionPlan`, {
    method: 'POST',
    data: params,
  });
}

export async function setAllGoods(params) {
  return request(`/Amaidan-Distribution-Web/distribution/distributionGoodsRef/setAllGoods`, {
    method: 'POST',
    data: params,
  });
}
